#ifndef _FNT_CACHE_THREAD_OPTIONS_H_
#define _FNT_CACHE_THREAD_OPTIONS_H_

#include "options.page.h"
#include "tracer.h"
#include "options.h"
#include <QtWidgets/QtWidgets>

class CacheThreadOptions: public OptionsPage {
	CacheThreadPriv* ctp;
	double cacheSizeDef;
	double cacheSizeSet;
	double cacheSizeUsed;
	int jobSizeWaitDef;
	int jobSizeWaitSet;
	int jobSizeWaitUsed;
	int jobSizeNoWaitDef;
	int jobSizeNoWaitSet;
	int jobSizeNoWaitUsed;
	QDoubleSpinBox* spinCacheSize;
	QSpinBox* spinJobSizeWait;
	QSpinBox* spinJobSizeNoWait;

	static CacheThreadOptions* _instance;

	CacheThreadOptions();
	~CacheThreadOptions();

	void getState(bool* a, bool* b, bool* c, bool* d) const override;
	void setStateImp(SessionState ts) override;
	void useDefaultImp() override;
	void saveDefaultImp() override;
	void applyChangesImp() override;
	void resetChangesImp() override;

	private Q_SLOTS:
	void cacheSizeChanged(double v);
	void jobSizeWaitChanged(int v);
	void jobSizeNoWaitChanged(int v);

	public:
	static CacheThreadOptions* instance() {
		if(!_instance)
			_instance=new CacheThreadOptions{};
		return _instance;
	}
	void attach(CacheThreadPriv* _ctp);
};

#endif
